package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/** 向文件中写入文本数据  */
public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.txt",true);
        String line = "心在跳是爱情如烈火，你在笑疯狂的人是我";
        byte [] date = line.getBytes(StandardCharsets.UTF_8);
      //  fos.write(date);
        fos.write(",银色的信念".getBytes(StandardCharsets.UTF_8));
        System.out.println("写入完毕");

        fos.close();
    }
}
